DataSource for Entity Framework in WPF
C1.LiveLinq Namespace / LiveViewExtensions Class / LiveAggregate Method / LiveAggregate<TSource>(View<TSource>,Expression<Func<TSource,TSource,TSource>>,Expression<Func<TSource,TSource,TSource>>,Expression<Func<TSource,TSource,Boolean>>) Method
The type of the elements of source.
A view to aggregate over.
An accumulator function to be invoked on each element that is added to the source view.
A function to be applied to the accumulated value and to an element to obtain the changed accumulated value, when an element is removed from the source view.
A function used to determine whether funcRemove must be applied when an element is removed from the source view, or the accumulated value is not affected by its removal.

In This Topic
    LiveAggregate<TSource>(View<TSource>,Expression<Func<TSource,TSource,TSource>>,Expression<Func<TSource,TSource,TSource>>,Expression<Func<TSource,TSource,Boolean>>) Method
    In This Topic
    Applies an accumulator function over a view.
    Syntax

    Parameters

    source
    A view to aggregate over.
    funcAdd
    An accumulator function to be invoked on each element that is added to the source view.
    funcRemove
    A function to be applied to the accumulated value and to an element to obtain the changed accumulated value, when an element is removed from the source view.
    funcRemoveDefined
    A function used to determine whether funcRemove must be applied when an element is removed from the source view, or the accumulated value is not affected by its removal.

    Type Parameters

    TSource
    The type of the elements of source.

    Return Value

    A view representing the final accumulator value.
    Remarks
    It is possible to use standard LINQ query operator Aggregate instead of LiveAggregate. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Aggregate will every time loop through the entire source collection and aggregate it from scratch, whereas LiveAggregate will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.
    See Also